import Vue from 'vue'
import VueRouter from "vue-router";
import Home from "@/pages/Home.vue";
import About from "@/pages/About.vue";
import UserList from "@/pages/UserList.vue";
import NewsList from "@/pages/NewsList.vue";
import Car from "@/pages/Car.vue";
import Book from "@/pages/Book.vue";
import Phone from "@/pages/Phone.vue";
import NotFound from "@/pages/NotFound.vue";
import Detail from "@/pages/Detail.vue";

Vue.use(VueRouter);
const router = new VueRouter({
    mode:"history",
    routes:[
        {
            path:'/home',
            component:Home,
            name:'home'
        },
        {
            path:'/about/:a/:b',
            alias:'/ab',
            component:About,
            name:'about'
        },
        {
            path:'/userlist',
            redirect:'/user',
        },
        {
            path:'/user',
            component:UserList
        },
        {
            path:'/newslist',
            alias:['/one','/two'],
            component:NewsList
        },
        {
            path:'/goodslist',
            components:{
                Car,
                Book,
                default:Phone
            }
        },
        {
            path:'/detail/:login.html',
            component:Detail
        },
        {
            path:"*",
            component:NotFound
        }
    ]
});
export default router;